package com.css.dzj.zfjg.modules.taskinfo.service;

import com.css.dzj.zfjg.common.exception.CvaException;
import com.css.dzj.zfjg.modules.admforce.entity.JgJgxwForceActionEntity;
import com.css.dzj.zfjg.modules.adminspection.entity.JgJgxwCheckActionEntity;
import com.css.dzj.zfjg.modules.admpunishment.entity.JgJgxwPunishActionEntity;
import com.css.dzj.zfjg.modules.cohostrelate.entity.JgLhjgRwxbglbEntity;
import com.css.dzj.zfjg.modules.feedback.entity.JgLhjgDffkEntity;
import com.css.dzj.zfjg.modules.jcdx.entity.JgLhjgJcdxEntity;
import com.css.dzj.zfjg.modules.other.entity.JgJgxwOtherActionEntity;
import com.css.dzj.zfjg.modules.taskinfo.entity.JgLhjgRwsEntity;
import com.css.dzj.zfjg.modules.taskinfo.entity.rwblVo;
import com.css.dzj.zfjg.modules.taskinfo.vo.RwjgLhfb;
import com.css.dzj.zfjg.modules.taskinfo.vo.RwsFqrVo;
import com.css.dzj.zfjg.modules.taskinfo.vo.rwjgLh;
import com.querydsl.core.QueryResults;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;

import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.Date;
import java.util.List;

/**
 * 任务办理接口
 * @author wt
 * @date 2020\2\20 0020
 */
public interface JgLhjgRwsService {

    /**
     * 添加任务书信息
     */
    void create(JgLhjgRwsEntity jgLhjgRws, JgLhjgJcdxEntity jgLhjgJcdxEntity, List<JgLhjgRwxbglbEntity> jgLhjgRwxbglbEntityList,JgJgxwCheckActionEntity jgJgxwCheckActionEntity,JgJgxwPunishActionEntity jgJgxwPunishActionEntity,JgJgxwForceActionEntity jgJgxwForceActionEntity,JgJgxwOtherActionEntity jgJgxwOtherActionEntity)throws CvaException;


    /**
     * 修改行任务书信息
     */
    void update(JgLhjgRwsEntity jgLhjgRwsEntity);

    /**
     * 通过id查询任务书信息
     */
    JgLhjgRwsEntity findById(String taskId);

    /**
     * 通过taskno查询任务书信息
     */
    JgLhjgRwsEntity findNo(String taskno);

    /**
     * 分页查询任务书信息
     */
    QueryResults<RwjgLhfb> queryPage(Pageable pageable, String taskname, String taskJgType, String objectname,
                                     String fbBureau, String fbDepartment, String createStartTime, String createEndTime,
                                     String receiveStartTime, String receiveEndTime, String taskState);

    /**
     * 删除任务书信息
     */
    Boolean delete(String taskId);

    /**
     * 联合监管任务办理答复提交
     */
    void reply(JgLhjgDffkEntity jgLhjgDffkEntity,
               JgJgxwCheckActionEntity jgJgxwCheckActionEntity,
               JgJgxwPunishActionEntity jgJgxwPunishActionEntity,
               JgJgxwForceActionEntity jgJgxwForceActionEntity,
               JgJgxwOtherActionEntity jgJgxwOtherActionEntity,
               HttpServletRequest request) throws Exception;


    //---------------------------------liyuan-------------------------------------//
    List<JgLhjgRwxbglbEntity> queryXBInfoById(String taskno);
    /**
     * 分办任务
     */
    void assignTask(String taskno, String fbBureau, String fbDepartment, String fbType) throws CvaException;

    /**
     *发起人获取列表
     */
    QueryResults<RwsFqrVo> queryFqTaskPage(String taskname, String taskJgtype, String objectName, String launchBureau, String launchState, String initiateunitno, String taskStartTimeFirst, String taskStartTimeSecond, PageRequest pageRequest);

    void launch(String taskno) throws CvaException;

    /**
     * 办理人监管任务列表
     */
    QueryResults<rwblVo> getBlrList(String orgName, String taskname, String taskJgType, String fbStartTime, String fbEndTime, String objectname, String taskState, Pageable pageable);

    /**
     * 修改反馈状态
     * @param
     * @throws CvaException
     */
    void feedBack(String taskno)throws CvaException;
    /**
     * 修改结束状态
     * @param
     * @throws CvaException
     */
    void end(String taskno)throws CvaException;
    /**
     * 获取最大任务编码
     * @param
     * @throws CvaException
     */
    String getMaxOne();
    /**
     * 修改任务书及子表
     * @param
     * @throws CvaException
     */
    void updateRwsAndall(JgLhjgRwsEntity jgLhjgRws, JgLhjgJcdxEntity jgLhjgJcdxEntity, List<JgLhjgRwxbglbEntity> jgLhjgRwxbglbEntityList,JgJgxwCheckActionEntity jgJgxwCheckActionEntity,JgJgxwPunishActionEntity jgJgxwPunishActionEntity,JgJgxwForceActionEntity jgJgxwForceActionEntity,JgJgxwOtherActionEntity jgJgxwOtherActionEntity)throws CvaException;

    /**

     * 获取单个发起任务
     * @param
     * @throws CvaException
     */
    JgLhjgRwsEntity queryInfoById(String taskno);


    /**
     * 分页查询认领超时提醒任务
     * @param pageable
     * @return
     */
    QueryResults<JgLhjgRwsEntity> queryOvertime(Pageable pageable);

    /**
     * 分页查询未认领超量提醒任务
     * @param pageable
     * @return
     */
    QueryResults<JgLhjgRwsEntity> queryOveramount(Pageable pageable);

    /**
     * 查询所有认领超时提醒任务的数量
     * @return
     */
    Long queryOvertimeCount();

    /**
     * 查询所有未认领超限任务的数量
     * @return
     */
    Long queryOveramountCount();
    /**
     * 查询所有任务书
     * @returnR
     */
    List queryAllRws();
}
